package service;

import pojo.User;
import pojo.Video;


/**
 * Membership Service Interface
 * @author Gang
 *
 */
/**
 * @author Gang
 *
 */

public interface IMemberShipService {
    
    
    /**
     * User login
     * @param user
     * @param pass
     * @return user object if login success
     */
    public User login(String user, String pass);
    
    
    /**
     * Register User
     * @param user  User Object
     * @return
     */
    public User register(User user);
    
    
    
    /**
     * User log out
     * @param userID
     */
    public void logout(int userID);
    
    
    /**
     * Update User information
     * @param user
     * @return
     */
    public User updateUser(User user);
    
    
    
    /**
     * Check whether username is existed
     * @param username
     * @return
     */
    public boolean isUsernameExist(String username);
    
    
    /**
     * Find user last watch video
     * @param uid
     * @return
     */
    public Video lastWatchVideo(User user);
    
    
    
    /**
     * Save User's last time watch history
     * @param uid
     * @param vid
     * @param minutes
     */
    public void saveLastWatch(User user, Video video, int minutes);
    
}
